extends Node

var spiritStone = 10
var cardprefab = load("res://prefab/card.tscn")


# 当节点进入场景树时调用
func _ready():
	$Button.pressed.connect(onAddCard)
	$TestAttackButton.pressed.connect(onTestAttack)
	$TestHurtButton.pressed.connect(onTestHurt)
	$StartFightButton.pressed.connect(OnStartFight)
	$TestChooseCard.pressed.connect(OnChooseCard)
	
var ChooseCardLayer = load("res://prefab/ChooseCardLayer.tscn")
func OnChooseCard():
	var layer = ChooseCardLayer.instantiate()
	add_child(layer)
	
	
func OnStartFight():
	$FightManager.startFight()
	
func onAddCard():
	var card = ZhuJianShi.CreateCard()
	$HandGroup.addCard(card)

func onTestAttack():
	var card:Card = $player_group.cards[0]
	var target: Card = $monster_group.cards[0]
	#card.runAttackAnim(target)

func onTestHurt():
	var target: Card = $monster_group.cards[0]
	target.runHurtAnim(30)


func _process(delta: float) -> void:
	pass
	
